import type {
  ${className}AddDTOType,
  ${className}UpdateDTOType,
  ${className}SearchDTOType
} from '@/types/${packName}/${className}Type'
import type { ResultTypes } from '@/types/base/api'
import { HttpResultUtil } from '@/apis/utils/HttpResultUtil'

export class ${className}Api {
  private static exportUrl: string = '/${packName}/export'
  private static addUrl: string = '/${packName}/add'
  private static updateUrl: string = '/${packName}/update'
  private static searchUrl: string = '/${packName}/search'
  private static deleteUrl: string = '/${packName}/delete'

  static export(data: ${className}SearchDTOType): Promise<boolean> {
  return HttpResultUtil.awaitDownload(this.exportUrl, data, 'post')
  }

  static add(data: ${className}AddDTOType): Promise<ResultTypes> {
    return HttpResultUtil.awaitPost(this.addUrl, data,true)
  }

  static update(data: ${className}UpdateDTOType): Promise<ResultTypes> {
    return HttpResultUtil.awaitPut(this.updateUrl, data,true)
  }

  static search(data: ${className}SearchDTOType): Promise<ResultTypes> {
    return HttpResultUtil.awaitGet(this.searchUrl, data,false)
  }

  static delete(idList: Array<number>): Promise<ResultTypes> {
    return HttpResultUtil.awaitDelete(this.deleteUrl, idList,true)
  }
}